﻿// -----------------------------------------------------------------------
// <copyright file="Truck.cs" company="">
// TODO: Update copyright text.
// </copyright>
// -----------------------------------------------------------------------

namespace Ex03.GarageLogic
{
    using System;
    using System.Collections.Generic;
    using System.Text;

    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    internal sealed class Truck : Vehicle
    {
        private const int k_NumberOfTires = 8;
        private const float k_MaxAirPressure = 27f;
        private const float k_MaxFuelTankCapacity = 150f;
        private const eTypeOfFuel k_TypeFuel = eTypeOfFuel.Octan96;
        private float m_VolumeCapacity;
        private bool m_IsHazardousMaterials;
     
        internal Truck(string i_Model, string i_PlateNum, List<Tire> i_Tires, EnergySource i_EnergySource, float i_VolumeCapacity, bool i_IsHazardousMaterials)
        {
            this.ModulName = i_Model;
            this.LicensePlate = i_PlateNum;
            this.TireCollection = i_Tires;
            this.SourceOfEnergy = i_EnergySource;
            this.CalculatePercentEnergyLeft();
            this.m_VolumeCapacity = i_VolumeCapacity;
            this.m_IsHazardousMaterials = i_IsHazardousMaterials;
        }

        internal static int NumOfTires
        {
            get { return k_NumberOfTires; }
        }

        internal static float MaxAirPressure
        {
            get { return k_MaxAirPressure; }
        }

        internal static float MaxFuelTankCapacity
        {
            get { return k_MaxFuelTankCapacity; }
        }

        internal static eTypeOfFuel TypeFuel
        {
            get { return k_TypeFuel; }
        }

        public float VolumeCapacity
        {
            get { return this.m_VolumeCapacity; }
        }

        public bool IsHazardousMaterials
        {
            get { return this.m_IsHazardousMaterials; }
        }

        internal override void GetVehicleData(ref StringBuilder o_VehicleData)
        {
            base.GetVehicleData(ref o_VehicleData);
            o_VehicleData.AppendFormat("{0}Truck volume capacity: {1}{0}Is contain hazardous materials: {2}{0}", Environment.NewLine, this.VolumeCapacity.ToString(), this.IsHazardousMaterials.ToString());
        }
    }
}
